﻿@model Authorize.Application.Account.Model.LoginViewModel
<div class="login-page">
    <div class="page-header">
        <h1>登录</h1>
    </div>
    @Html.Partial("_ValidationSummary")
    <div class="row">
        @if (Model.EnableLocalLogin)
        {
            <div class="col-md-6 col-md-offset-3 col-sm-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title">
                            本地登录
                            <a class="pull-right"
                               asp-action="Register"
                               asp-route-returnUrl="@Model.ReturnUrl">
                                注册
                            </a>
                        </h3>
                    </div>
                    <div class="panel-body">
                        <form asp-route="Login">
                            <input type="hidden" asp-for="ReturnUrl" />
                            <fieldset>
                                <div class="form-group">
                                    <label asp-for="Username"></label>
                                    <input class="form-control" placeholder="Username" asp-for="Username" autofocus>
                                </div>
                                <div class="form-group">
                                    <label asp-for="Password"></label>
                                    <input type="password" class="form-control" placeholder="Password" asp-for="Password" autocomplete="off">
                                </div>
                                @if (Model.AllowRememberLogin)
                                {
                                    <div class="form-group login-remember">
                                        <label asp-for="RememberLogin">
                                            <input asp-for="RememberLogin">
                                            <strong>记住我</strong>
                                        </label>
                                    </div>
                                }
                                <div class="form-group">
                                    <button class="btn btn-primary" name="button" value="login">登录</button>
                                    <button class="btn btn-default" name="button" value="cancel">取消</button>
                                </div>
                            </fieldset>
                        </form>
                    </div>
                </div>
            </div>
        }
        @*@if (Model.VisibleExternalProviders.Any())
            {
                <div class="col-md-6 col-sm-6 external-providers">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title">External Login</h3>
                        </div>
                        <div class="panel-body">
                            <ul class="list-inline">
                                @foreach (var provider in Model.VisibleExternalProviders)
                                {
                                    <li>
                                        <a class="btn btn-default"
                                           asp-action="ExternalLogin"
                                           asp-route-provider="@provider.AuthenticationScheme"
                                           asp-route-returnUrl="@Model.ReturnUrl">
                                            @provider.DisplayName
                                        </a>
                                    </li>
                                }
                            </ul>
                        </div>
                    </div>
                </div>
            }
            @if (!Model.EnableLocalLogin && !Model.VisibleExternalProviders.Any())
            {
                <div class="alert alert-warning">
                    <strong>Invalid login request</strong>
                    There are no login schemes configured for this client.
                </div>
            }*@
    </div>
</div>

